<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jsp/common/taglib.jsp"%>
<script type="text/javascript">
	var list;
	$(function() {
		list = lyGrid({
			pagId : 'paging',
			l_column : [{
				colkey : "accountname",
				name : "登录名",
				isSort : true
			}, {
				colkey : "loginip",
				name : "IP"
			}, {
				colkey : "logintime",
				name : "登录时间",
				isSort : true
			}, {
				colkey : "id",
				name : "操作",
				renderData : function(rowindex, data, rowdata, colkeyn) {
					var s = '<input type="button" value="删除" onclick="del('+data+');"/>';
					return s;
				}
			} ],
			jsonUrl : '${ctx}/userlogin/findByPage.shtml',
			pagecode : 5, //最多显示多少页码
			serNumber : true
		});
		$("#search").click("click", function() {// 绑定查询按扭
			var searchParams = $("#searchForm").serializeJson();
			list.setOptions({
				data : searchParams
			});
		});
	})
	function del(id){
		$.ajax({
			url:"${ctx}/userlogin/del.shtml",
			data:{
				id: id
			},
			type:"post",
			dataType:"json",
			success : function(data){
				if(data){
					loadList();
				}
			}
		})
	}
	function loadList(){
		list.loadData();
		parent.autoHeight();
	}
</script>
<div class="m-b-md">
	<form class="form-inline" role="form" id="searchForm" name="searchForm">
		<div class="form-group">
			<label class="control-label"> <span
				class="h4 font-thin v-middle">账号:</span></label> <input
				class="input-medium ui-autocomplete-input" id="accountname"
				name="accountname"/>
		</div>
		<input type="button" class="btn btn-default" id="search" value="查询"/>
		<!-- <a href="javascript:void(0)" class="btn btn-default" id="search">查询</a> -->
	</form>
</div>
<div>
	<div id="paging" class="pagclass"></div>
</div>
